import { StateCreator } from 'zustand';
import { BearActions } from './bear';
import { FishActions } from './fish';
import { usePersonStore } from './person';

export type BearFishActions = {
  removeAllBearFish: () => void;
};


export const createBearFishSlice: StateCreator<
  BearFishActions & BearActions & FishActions,
  [["zustand/immer", never]],
  [],
  BearFishActions
> = 
  (set, get) => ({
    removeAllBearFish: () => {
      usePersonStore.getState().addPerson();
      // MARK: 6、通过 get 可获取到完整的 store 数据
      get().removeAllBears();
      get().removeAllFish();
    },
  });
